package com.suliu.practice.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Properties;

public class StreamReaderWriterTest {
	//字符流InputStreamReader OutputStreamWriter 用来在字节流和字符流之间搭起一座桥
	public static void main(String[] args) throws IOException {
//		BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(new FileOutputStream("file.txt")));
//		bw.write("www.baidu.com");
//		bw.write("\n");
//		bw.write("www.google.com");
//		bw.close();
//		
//		BufferedReader br=new BufferedReader(new InputStreamReader(new FileInputStream("file.txt")));
//		String str=br.readLine();
//		while(null!=str){
//			System.out.println(str);
//			str=br.readLine();
//		}
//		br.close();
		
		InputStreamReader isr=new InputStreamReader(System.in);//从键盘读取
		BufferedReader br=new BufferedReader(isr);
		String str;
		while(null!=(str=br.readLine())){
			System.out.println(str);
		}
		br.close();
	}

}
